﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using control.Biz;

namespace TrangSucShop.administrator
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnDangNhap_Click(object sender, EventArgs e)
        {
            string username = txtusername.Text;
            string password = TextBox1.Text;
            BizKhachHang kh = new BizKhachHang()
            {
                Username = username,
                Password = password
            };
            bool resuilt = kh.DangNhap();
            if (resuilt == true&&kh.Quyen.ID==1)
            {
                lbThongBao.Text = "";
                Session["QuanLy"] = kh;
                Response.Redirect("Default.aspx");
            }
            else
            {
                lbThongBao.Text = "Đăng Nhập Thất  Bại !!! ";
            }
        }
    }
}
